import Posts from '@/app/ui/posts'
import { Suspense } from 'react'
import { select } from '@/lib/simple-db';
import Loading from './loading'

async function getPosts() {
  const posts = await select('SELECT id,name FROM users');
  return posts;
}
export default function Page() {
  // 不要等待数据获取函数
  const posts = getPosts()
 
  return (
    <Suspense fallback={<Loading />}>
      <Posts posts={posts} />
    </Suspense>
  )
}